{% extends  'df_user/base.html' %}
{% load static %}
{% block head %}
    <script type="text/javascript" src="{% static 'js/jquery-1.12.4.min.js' %}"></script>
    <script type="text/javascript">
        $(function(){
            $(".add_goods").click(function(){
                url = 'http://127.0.0.1:8080/cart/add' + this.id + '_1'; // 列表页面只能添加1件商品
                $.get(url, function(data){
                    alert("成功添加此商品到购物车内！");
                });
            });
        });
    </script>
{% endblock head %}
{% block body %}
	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
            <h3>用户中心</h3>
            <ul>
                <li><a href="/user/info" class="active">· 个人信息</a></li>
                <li><a href="/user/order1">· 全部订单</a></li>
                <li><a href="/user/site">· 收货地址</a></li>
            </ul>
        </div>
		<div class="right_content clearfix">
			<div class="info_con clearfix">
                <h3 class="common_title2">基本信息</h3>
                <ul class="user_info_list">
                    <li><span>用户名：</span>{{user_name}}</li>
                    <li><span>联系方式：</span>{{user_phone}}</li>
                    <li><span>联系地址：</span>{{user_address}}</li>
                </ul>
            </div>
				
			<h3 class="common_title2">最近浏览</h3>
			<div class="has_view_list">
				<ul class="goods_type_list clearfix">
					{% for goods in goods_list %}
                    <li>
                        <a href="/goods/{{goods.id}}"><img src="{{STATIC_URL}}{{goods.gpic}}"></a>
                        <h4><a href="/goods/{{goods.id}}">{{goods.gtitle}}</a></h4>
                        <div class="operate">
                            <span class="prize">￥{{goods.gprice}}</span>
                            <span class="unit">{{goods.gunit}}</span>
                            <a href="javascript:;"  id="{{goods.id}}" class="add_goods" title="加入购物车"></a>
                        </div>
                    </li>
                    {% endfor %}
				</ul>
			</div>
		</div>
	</div>
{% endblock body %}


